// src/services/userService.ts
import { AigcTask } from 'server/entity/AigcTask';
import { AppDataSource } from '../db';
import { AttributionPoint } from "../entity/AttributionPoint";

export async function getTopFiveAttributionPoints(): Promise<AttributionPoint[]> {
  const attributionPointRepository = AppDataSource.getRepository(AttributionPoint);
  const topFivePoints = await attributionPointRepository.createQueryBuilder('attribution_point')
      .select('attribution_point')
      .orderBy('attribution_point.id', 'DESC') // 根据需求更改排序条件
      .limit(5)
      .getMany();
  return topFivePoints;
}